<?php

Raise::load('core.RaiseConsoleApplication');

/**
 * TestCoreRaiseConsoleApplication class
 * Testing unit of 'phpraise/core/RaiseConsoleApplication.php'
 *
 * @author Sam Yong
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License v3
 * @package Raise.UnitTest.Test
 */
class TestCoreRaiseConsoleApplication extends RaiseTest {
    
    public static function testClass(){
        self::assertClassExists('RaiseConsoleApplication');
        self::assertClassExtends('RaiseConsoleApplication', 'RaiseObject');
        self::assertClassMethod('RaiseConsoleApplication', 'arguments');
        self::assertClassMethod('RaiseConsoleApplication', 'write');
        self::assertClassMethod('RaiseConsoleApplication', 'writeLine');
        self::assertClassMethod('RaiseConsoleApplication', 'readLine');
    }

    public static function testRun(){
        try{
            $app = new RaiseConsoleApplication(array());
            self::addError('Supposed error was not thrown');
        }catch(Exception $e){
            self::assert($e);
        }
    }

    public static function testRun2(){
        self::addMessage('Note that the slow run here is due to PHP having to load all its extension in its own separate process in order to run the RaiseConsoleApplication mock up.');
        //$output = exec('php ' . RaisePath::combine(RaisePath::currentWorkingPath(), 'mocks\raise\MockConsoleApplication.php'));
        //self::assertStrictEqual($output, 'testing');
    }

}
